<h4 style="font-weight: bolder;text-align: center;">美霖达科技有限公司采购合同</h4>
<div class="box-body table-responsive no-padding">
    <table class="table">
        <tbody>
        <tr>
            <td style="text-align: right;width: 15%;">
                <label style="padding-top: 8px;">采购单号</label>
            </td>
            <td style="text-align: left;width: 35%;">{{ $purchase->purchase_no }}</td>
            <td style="text-align: right;width: 15%;">
                <label style="padding-top: 8px;">签订日期</label>
            </td>
            <td style="text-align: left;width: 35%;">{{ date('Y/m/d',strtotime($purchase->order_at)) }}</td>
        </tr>
        <tr>
            <td style="text-align: right;width: 15%;">
                <label style="padding-top: 8px;">甲方</label>
            </td>
            <td style="text-align: left;width: 35%;">
                <select id="party_a" name="param[party_a]">
                    {{ getOptions(\App\Models\Purchase\PurchaseOrderContract::$_partyA,1) }}
                </select>
            </td>
            <td style="text-align: right;width: 15%;">
                <label style="padding-top: 8px;">电话(Tel)</label>
            </td>
            <td style="text-align: left;width: 35%;">
                <input type="text" class="form-copy" name="param[party_a_tel]" value="13714191405" placeholder="电话(Tel)">
            </td>
        </tr>
        <tr>
            <td style="text-align: right;width: 15%;">
                <label style="padding-top: 8px;">地址</label>
            </td>
            <td colspan="3" style="text-align: left;">
                <input type="text" id="party_a_address" class="form-copy" style="width: 500px;" name="param[party_a_address]" value="香港九龙旺角花园街2-16号好景商业中心5楼502C室" placeholder="地址">
            </td>
        </tr>
        <tr>
            <td style="text-align: right;width: 15%;">
                <label style="padding-top: 8px;">乙方</label>
            </td>
            <td  style="text-align: left;width: 35%;">
                <input type="text" class="form-copy" style="width: 255px;" name="param[party_b]" value="{{ $supplier->name ?? '' }}" placeholder="乙方">
            </td>
            <td style="text-align: right;width: 15%;">
                <label style="padding-top: 8px;">电话(Tel)</label>
            </td>
            <td  style="text-align: left;width: 35%;">
                <input type="text" class="form-copy" name="param[party_b_tel]" value="{{ $supplierContact->cellphone ?? '' }}" placeholder="电话(Tel)">
            </td>
        </tr>
        <tr>
            <td style="text-align: right;width: 15%;">
                <label class="asterisk" style="padding-top: 8px;">地址</label>
            </td>
            <td colspan="3" style="text-align: left;">
                <input type="text" class="form-copy" style="width: 500px;" name="param[party_b_address]" value="{{ $supplier->address ?? '' }}" placeholder="地址">
            </td>
        </tr>
        <tr>
            <td style="text-align: right;width: 15%;">
                <label style="padding-top: 8px;">联系人</label>
            </td>
            <td colspan="3" style="text-align: left;width: 35%;">
                <input type="text" class="form-copy" name="param[contact_person]" value="{{ $supplierContact->contact ?? '' }}" placeholder="联系人">
            </td>
        </tr>
        </tbody>
    </table>
</div>
<script language="JavaScript" type="text/javascript">
    $(function () {
        $("#party_a").select2({"placeholder":"甲方","width": '500px'}).bind("change", function() {
            if(this.value == "2") {
                $("#party_a_address").val('深圳市南山区打石二路云科技大厦2103-2105室');
            } else if(this.value == "3"){
                $("#party_a_address").val('深圳市南山区桃源街道留仙大道1183号南山云谷创新产业园5栋朗山阁701-706');
            }else{
                $("#party_a_address").val('香港九龙旺角花园街2-16号好景商业中心5楼502C室');
            }
        });
    });
</script>
